<template>
  <div class="page-wrapper">
    <div class="page-wrapper__body">
      <div class="page-container is-form" v-loading="isLoading">
        <el-form ref="roleForm" :model="model" label-width="140px" label-position="left">
          <div class="block-title"><i>¶</i><el-button type="default" icon="el-icon-back" round size="mini" class="more" @click="onBack">返回</el-button> 岗位招聘信息</div>
          <div style="height:20px;"></div>
          <el-form-item label="主体: ">
            <p class="form-text" v-html="model.groupName"></p>
          </el-form-item>
          <el-form-item label="需求公司: ">
            <p class="form-text" v-html="model.recName"></p>
          </el-form-item>
          <el-form-item label="一级部门: ">
            <p class="form-text" v-html="model.depart1"></p>
          </el-form-item>
          <el-form-item label="二级部门: ">
            <p class="form-text" v-html="model.depart2"></p>
          </el-form-item>
          <el-form-item label="招聘岗位: ">
            <p class="form-text" v-html="model.jobTitle"></p>
          </el-form-item>
          <el-form-item label="岗位类别: ">
            <p class="form-text" v-html="model.jobType"></p>
          </el-form-item>
<!--          <el-form-item label="需求人数: ">-->
<!--            <p class="form-text" v-html="model.needCount"></p>-->
<!--          </el-form-item>-->
          <el-form-item label="岗位职责: ">
            <p class="form-text" v-html="model.jobDesc"></p>
          </el-form-item>
          <el-form-item label="任职要求: ">
            <p class="form-text" v-html="model.requirement"></p>
          </el-form-item>
          <el-form-item label="工作地点: ">
            <p class="form-text" v-html="model.workPlace"></p>
          </el-form-item>
<!--          <el-form-item label="是否有常规出差: ">-->
<!--            <p class="form-text" v-html="model.isTravel"></p>-->
<!--          </el-form-item>-->
<!--          <el-form-item label="是否要求提前实习: ">-->
<!--            <p class="form-text" v-html="model.isAdvanceInternship"></p>-->
<!--          </el-form-item>-->
<!--          <el-form-item label="目标院校: ">-->
<!--            <p class="form-text" v-html="model.destSchool"></p>-->
<!--          </el-form-item>-->
<!--          <el-form-item label="目标专业: ">-->
<!--            <p class="form-text" v-html="model.destMajor"></p>-->
<!--          </el-form-item>-->
<!--          <el-form-item label="学历要求: ">-->
<!--            <p class="form-text" v-html="model.eduDegree"></p>-->
<!--          </el-form-item>-->
<!--          <el-form-item label="目标城市(需求人数): ">-->
<!--            <p class="form-text">-->
<!--              <strong style="padding-right:10px;">杭州: </strong>-->
<!--              <span v-html="model.hangzhouNeedCount"></span>-->
<!--            </p>-->
<!--            <p class="form-text">-->
<!--              <strong style="padding-right:10px;">南京: </strong>-->
<!--              <span v-html="model.nanjingNeedCount"></span>-->
<!--            </p>-->
<!--            <p class="form-text">-->
<!--              <strong style="padding-right:10px;">武汉: </strong>-->
<!--              <span v-html="model.wuhanNeedCount"></span>-->
<!--            </p>-->
<!--            <p class="form-text">-->
<!--              <strong style="padding-right:10px;">其他城市: </strong>-->
<!--              <span v-html="model.cityNeedCount"></span>-->
<!--            </p>-->
<!--          </el-form-item>-->
<!--          <el-form-item label="院校层次(需求人数): ">-->
<!--            <p class="form-text">-->
<!--              <strong style="padding-right:10px;">985/211: </strong>-->
<!--              <span v-html="model.cuSchoolNeedCount"></span>-->
<!--            </p>-->
<!--            <p class="form-text">-->
<!--              <strong style="padding-right:10px;">普通院校: </strong>-->
<!--              <span v-html="model.regularSchoolNeedCount"></span>-->
<!--            </p>-->
<!--          </el-form-item>-->
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
  import {getDetail} from "../../api/recruit";

  export default {
    name: "detail",
    data(){
      return{
        model:{},
        params:{
          id:0
        },
        isLoading:false
      }
    },
    methods:{
      onBack(){
        this.$router.push('/job/list')
      },
      async loadData(){
        if(this.params.id <= 0){
          this.$alert('参数错误', '提示', { confirmButtonText: '确定',okFn: ()=> {
              this.onBack()
            }});
          return false;
        }
        this.isLoading = true;
        let resp = await getDetail(this.params.id);
        if(!this.qUtil.validResp(resp)){
          this.isLoading = false;
          this.$alert('请求数据失败!', '提示', { confirmButtonText: '确定',okFn: ()=> {
              this.onBack()
            }});
          return false;
        }
        this.model = resp.data.model || {};
        this.isLoading = false;
      },
    },
    mounted(){
      this.params.id = parseInt(this.$route.params.id) || 0;
      this.loadData();
    }
  }
</script>

<style scoped>
.form-text{
  margin-top:-6px;
  text-align: left;
  line-height: 30px;
  font-size:14px;
  color:#666;
}
</style>